package com.example.blogapi.controller;

import com.example.blogapi.domain.MsCategory;
import com.example.blogapi.domain.MsTag;
import com.example.blogapi.service.MsTagService;
import com.example.blogapi.vo.CategoryVo;
import com.example.blogapi.vo.Result;
import com.example.blogapi.vo.TagVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/tags")
public class TagsController {
    @Autowired
    MsTagService msTagService;

    @GetMapping("/hot")
    public Result getHotTags(){
        int limit = 6;
        List<MsTag> hotTags = msTagService.getHotTags(limit);
        return Result.success(hotTags);
    }
    @GetMapping
    public Result getAllTags(){
        return msTagService.getAllTags();
    }
}
